package org.iweb.html.api;

public class JScript extends AbstractHtmlElement{

	private static final long serialVersionUID = -3340214354402301627L;
	private String script;
	
	public JScript(){
		//Render.getInstance().register(this);
	}
	
	public JScript on(String event,String selector,JFunction function){
		setScript(getScript()+"bodyVar.on(\""+event+"\",\""+selector+"\","+function.getBodyFunction()+");");
		return this;
	}

	public String getScript() {
		if(script==null)
			script="";
		return script;
	}

	public JScript setScript(String script) {
		this.script = script;
		return this;
	}

	@Override
	public String getTag() {
		return "";
	}

	/*
	public static void register(JFunction jFunction){
		Render.getInstance().register(jFunction);
	}
	*/
}
